//
//  main.m
//  oc
//
//  Created by mac on 16-4-7.
//  Copyright (c) 2016年 wangchenglong. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Atom.h"
#import "Animal.h"
#import "People.h"
#import "Mouse.h"
#import "Chick.h"
int main(int argc, const char * argv[])
{

    @autoreleasepool {
        
        // insert code here...
        NSLog(@"Hello, World!");
        Atom *atom=[[Atom alloc] init];
        NSLog(@"Atom chemical element name:%@",atom.chemicalElement);
           }
    People *people=[[People alloc] init];
    people.name=@"王成龙";
    [people speak];
    
    Mouse *mouse=[[Mouse alloc]init];
    mouse.name=@"老鼠";
    
    [mouse burrow];

    Chick *chick=[[Chick alloc]init];
    chick.name=@"小鸡下蛋";
    [chick layeggs];
    
    NSArray * arr=@[people,mouse,chick];
    NSLog(@"name: %@",[arr componentsJoinedByString:@","]);
    

    NSString *str = @"ni ,shi, 帅哥, 蒋乐琦";
    NSArray * and = [str componentsSeparatedByString:@","];
    for(int i=0;i<and.count;i++){
        NSString *s=and[i];
        NSLog(@"%d %@",i,s);
    
    }
    
    NSString *stt = @"v,s,w,b,f,g";
    NSArray * anb = [stt componentsSeparatedByString:@","];
    anb=[anb sortedArrayUsingSelector:@selector(compare:)];
    for(int i=0;i<anb.count;i++){
        NSString *s=anb[i];
        NSLog(@"%d %@",i,s);
    }
    
    NSArray *numbers =@[@(95),@(43),@(14),@(29)];
    numbers =[numbers sortedArrayUsingSelector:@selector(compare:)];
    for(int i=0;i<numbers.count;i++){
        NSNumber *s=numbers[i];
        NSLog(@"%d %@",i,s);
    }
    return 0;
    
}

